Creating nested dictionary based on the checks done on another nested dictionaries python

visit shbcf.ru